package com.block.db.mapper;

import com.block.db.entity.MemberExtInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户扩展信息表 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2022-08-03
 */
public interface MemberExtInfoMapper extends BaseMapper<MemberExtInfo> {

    MemberExtInfo getMemberExtInfoByUidLock(@Param("uid") Long uid);

    @Select("SELECT info.uid AS uid,(2022-substring(base.id_card,7,4)) AS years FROM ml_member_ext_info base LEFT JOIN ml_member_info info ON info.uid=base.uid WHERE 1=1 AND (base.zhima_score='zm005') AND base.create_time> '2022-10-25 17:30:34' AND base.create_time< '2022-10-26 23:59:59' HAVING (years>=24 AND years<=42)")
    List<Map<String, Object>> getTargetListInfo();

    List<MemberExtInfo> getExtInfoByTime(@Param("startTime")String startTime, @Param("endTime")String endTime);

    MemberExtInfo selectByMobileMd5(@Param("mobileMd5") String mobileMd5);

    void startLeverUpdate(@Param("uid") Long uid,@Param("startLevel") Integer startLevel);
}
